import { ref} from 'vue'
import { defineStore } from 'pinia'

// 配置数据
export const useDownloadManage1 = defineStore('downloadManage1', () => {
  const downingList = ref<any[]>([]);//正在下载的list
  const finishList = ref<any[]>([]);//下载完成的list
  const downloadFinishRedFlag = ref(false);//是否下载完成，红色提示，下载完成的红点

  //这两个方法，是给管理子页面使用的，同步来自主界面的数据
  const setDowningList=(list:any[])=> {
    downingList.value = list;
  }
  const setFinishList=(list:any[])=> {
    finishList.value = list;
  }
  const setDownloadFinishRedFlag = (value:boolean) => {
    downloadFinishRedFlag.value = value;
  }

  return {
    downingList,
    finishList,
    downloadFinishRedFlag,
    setDowningList,
    setFinishList,
    setDownloadFinishRedFlag
  }
})
